<?php
    $page = $_GET['page'];
    //$userID = $_GET['userID'];
    
if($page=='client')
{
    require('db_connection.php');
    //$userID = $_POST['$userID'];
    //echo $userID;
    $libraryCardNo = $_POST['libraryCardNo'];
    $lastName = $_POST['lastName'];
    $firstName = $_POST['firstName'];
    $middleName = $_POST['middleName'];
    $contactNo = $_POST['contactNo'];
    $address =$_POST['address'];
    $email = $_POST['email'];
    $schoolorg = $_POST['schoolorg'];
    $guarantor = $_POST['guarantor'];
    
    $sql = "SELECT * FROM tblclient";
    $result = mysql_query($sql);
    $ctr = mysql_num_rows($result)+1;
    
    $query = "INSERT INTO tblclient VALUES ('$libraryCardNo','$lastName','$firstName','$middleName','$address','$contactNo','$email','$schoolorg','$ctr','1','$guarantor','secret','activated')";
    
    $result = mysql_query($query);

    if($result){
        echo " <script>alert('Record Successfully saved!')</script> ";
        echo ("<script> document.location.href='client.php'</script>");
    }

    mysql_close();
}
?>

